#include <iostream>

int main() {
    int size;
    std::cout << "Enter the size of the array: ";
    std::cin >> size;

    // 动态分配数组内存
    int *dynamicArray = new int[size];

    // 初始化动态数组
    for (int i = 0; i < size; ++i) {
        dynamicArray[i] = i + 1;
    }

    // 输出动态数组元素
    for (int i = 0; i < size; ++i) {
        std::cout << "Element at index " << i << ": " << dynamicArray[i] << std::endl;
    }

    // 释放动态数组内存
    delete[] dynamicArray;

    return 0;
}
